package spring.cloud.study.service.hystrix;

import org.springframework.stereotype.Component;

import spring.cloud.study.entity.base.ResponseModel;
import spring.cloud.study.service.PayFeignClient;

/**
 * @ClassName:GlobalFallBack
 * @Description:hystrix全局服务降级/异常处理
 * @author:Calvin.W
 * @date:2021年12月13日 上午10:08:50
 */
@Component
public class PayFallbackService implements PayFeignClient {

	@Override
	public ResponseModel buy(String goodId, int amount) {
		System.out.println("PayFallbackService buy 服务降级处理，请稍后重试");
		return ResponseModel.errorMsg("PayFallbackService buy 服务降级处理，请稍后重试");
	}

	@Override
	public ResponseModel buyTimeOut(String goodId, int amount) {
		// TODO Auto-generated method stub
		return ResponseModel.errorMsg("PayFallbackService buyTimeOut 服务降级处理，请稍后重试");
	}

}
